#ifndef LRCPAGE_H
#define LRCPAGE_H

#include <QWidget>

#include <QPropertyAnimation>

//一行歌词
struct LrcLine
{
    qint64 _time;
    QString _text;

    LrcLine(qint64 time,QString text)
        :_time(time)
        ,_text(text)
    {}
};


namespace Ui {
class LrcPage;
}

class LrcPage : public QWidget
{
    Q_OBJECT

public:
    explicit LrcPage(QWidget *parent = nullptr);
    ~LrcPage();

    bool parseLrc(const QString& lrcPath);

    void showLrcWord(qint64 time);

    int getLineLrcWordIndex(qint64 time);

    QString getLineLrcWord(int index);

private:
    Ui::LrcPage *ui;

    QPropertyAnimation* animation;

    QVector<LrcLine> lrcLines;
};

#endif // LRCPAGE_H
